home *** CD-ROM | disk | FTP | other *** search
-
- // Handles moving and rendering the base, whether under player or demo control.
-
- #import <gamekit/gamekit.h>
-
- #define BASE_WIDTH 30
- #define BASE_HEIGHT 20
-
- // how fast the base can move
- #define BASE_STEPS 2
-
- #define BASE_DYING (GK_DEAD_ACTOR + 2)
- #define BASE_DEAD GK_DEAD_ACTOR
- #define BASE_ALIVE (GK_DEAD_ACTOR + 1)
- #define BASE_FRAMES 8
-
- #define BASE_DIE_DELAY_SIZE 1 // how many dead cycles while base dies
-
- #define NXI_LEFTKEY 0
- #define NXI_RIGHTKEY 1
- #define NXI_FIREKEY 2
-
- @interface NXIPlayer:GKActor
- {
- id basesLeft; // PlayerUpView
- BOOL playerStopped;
- float xdirection, screenWidth;
- NXEvent keys[3];
- }
-
- - init; // initialize the player
- - (BOOL)newPlayer; // get and set up a new base. Returns NO if can't
- - resetPlayer; // reset all player info
- - move:sender; // Move the base one animation frame
- - demoMove:sender; // Move the base one animation frame (demo cntl)
- - collidedWith:anActor; // called when it is detected that we hit something
- - updateDrawingState; // change the internal state machine (ie. advance
- - setDirection:(int)newDirection; // sent by GameView at right time
-
- @end
-